<!DOCTYPE html>
<html lang="" xml:lang="">
<head>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title>7 Latex | 编程语言笔记</title>
  <meta name="description" content="7 Latex | 编程语言笔记" />
  <meta name="generator" content="bookdown 0.35 and GitBook 2.6.7" />

  <meta property="og:title" content="7 Latex | 编程语言笔记" />
  <meta property="og:type" content="book" />
  
  
  

  <meta name="twitter:card" content="summary" />
  <meta name="twitter:title" content="7 Latex | 编程语言笔记" />
  
  
  

<meta name="author" content="云腾足下" />



  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  
  
<link rel="prev" href="C.html"/>
<link rel="next" href="Blog.html"/>
<script src="libs/jquery-3.6.0/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/fuse.js@6.4.6/dist/fuse.min.js"></script>
<link href="libs/gitbook-2.6.7/css/style.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-table.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-bookdown.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-highlight.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-search.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-fontsettings.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-clipboard.css" rel="stylesheet" />








<link href="libs/anchor-sections-1.1.0/anchor-sections.css" rel="stylesheet" />
<link href="libs/anchor-sections-1.1.0/anchor-sections-hash.css" rel="stylesheet" />
<script src="libs/anchor-sections-1.1.0/anchor-sections.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  jax: ["input/TeX","output/SVG"],
  extensions: ["tex2jax.js","MathMenu.js","MathZoom.js"],
  TeX: {
    extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
  }
});
</script>
<script type="text/javascript"
   src="../../../MathJax/MathJax.js">
</script>


<style type="text/css">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
  { counter-reset: source-line 0; }
pre.numberSource code > span
  { position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
  { content: counter(source-line);
    position: relative; left: -1em; text-align: right; vertical-align: baseline;
    border: none; display: inline-block;
    -webkit-touch-callout: none; -webkit-user-select: none;
    -khtml-user-select: none; -moz-user-select: none;
    -ms-user-select: none; user-select: none;
    padding: 0 4px; width: 4em;
    color: #aaaaaa;
  }
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa;  padding-left: 4px; }
div.sourceCode
  {   }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { color: #008000; } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { color: #008000; font-weight: bold; } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>

<style type="text/css">
  
  div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
</style>

</head>

<body>



  <div class="book without-animation with-summary font-size-2 font-family-1" data-basepath=".">

    <div class="book-summary">
      <nav role="navigation">

<ul class="summary">
<li class="chapter" data-level="" data-path="index.html"><a href="index.html"><i class="fa fa-check"></i>序</a></li>
<li class="chapter" data-level="1" data-path="Maple.html"><a href="Maple.html"><i class="fa fa-check"></i><b>1</b> Maple</a>
<ul>
<li class="chapter" data-level="1.1" data-path="Maple.html"><a href="Maple.html#快捷键"><i class="fa fa-check"></i><b>1.1</b> 快捷键</a></li>
<li class="chapter" data-level="1.2" data-path="Maple.html"><a href="Maple.html#几个基本的代数处理"><i class="fa fa-check"></i><b>1.2</b> 几个基本的代数处理</a></li>
<li class="chapter" data-level="1.3" data-path="Maple.html"><a href="Maple.html#产生序列"><i class="fa fa-check"></i><b>1.3</b> 产生序列</a></li>
<li class="chapter" data-level="1.4" data-path="Maple.html"><a href="Maple.html#函数定义"><i class="fa fa-check"></i><b>1.4</b> 函数定义</a>
<ul>
<li class="chapter" data-level="1.4.1" data-path="Maple.html"><a href="Maple.html#参数的宣称"><i class="fa fa-check"></i><b>1.4.1</b> 参数的宣称</a></li>
</ul></li>
<li class="chapter" data-level="1.5" data-path="Maple.html"><a href="Maple.html#控制流"><i class="fa fa-check"></i><b>1.5</b> 控制流</a></li>
<li class="chapter" data-level="1.6" data-path="Maple.html"><a href="Maple.html#画图"><i class="fa fa-check"></i><b>1.6</b> 画图</a></li>
<li class="chapter" data-level="1.7" data-path="Maple.html"><a href="Maple.html#矩阵"><i class="fa fa-check"></i><b>1.7</b> 矩阵</a></li>
<li class="chapter" data-level="1.8" data-path="Maple.html"><a href="Maple.html#一句话tips"><i class="fa fa-check"></i><b>1.8</b> 一句话Tips</a></li>
</ul></li>
<li class="chapter" data-level="2" data-path="Julia.html"><a href="Julia.html"><i class="fa fa-check"></i><b>2</b> Julia</a>
<ul>
<li class="chapter" data-level="2.1" data-path="Julia.html"><a href="Julia.html#julia的一些体会"><i class="fa fa-check"></i><b>2.1</b> Julia的一些体会</a>
<ul>
<li class="chapter" data-level="2.1.1" data-path="Julia.html"><a href="Julia.html#关于函数的参数"><i class="fa fa-check"></i><b>2.1.1</b> 关于函数的参数</a></li>
</ul></li>
<li class="chapter" data-level="2.2" data-path="Julia.html"><a href="Julia.html#julia的一些常用包"><i class="fa fa-check"></i><b>2.2</b> Julia的一些常用包</a>
<ul>
<li class="chapter" data-level="2.2.1" data-path="Julia.html"><a href="Julia.html#优化包"><i class="fa fa-check"></i><b>2.2.1</b> 优化包</a></li>
<li class="chapter" data-level="2.2.2" data-path="Julia.html"><a href="Julia.html#julia数值求根"><i class="fa fa-check"></i><b>2.2.2</b> Julia数值求根</a></li>
<li class="chapter" data-level="2.2.3" data-path="Julia.html"><a href="Julia.html#dataframes包"><i class="fa fa-check"></i><b>2.2.3</b> <code>DataFrames</code>包</a></li>
</ul></li>
<li class="chapter" data-level="2.3" data-path="Julia.html"><a href="Julia.html#julia的ide体验"><i class="fa fa-check"></i><b>2.3</b> Julia的IDE体验</a></li>
<li class="chapter" data-level="2.4" data-path="Julia.html"><a href="Julia.html#其他tips"><i class="fa fa-check"></i><b>2.4</b> 其他tips</a></li>
</ul></li>
<li class="chapter" data-level="3" data-path="Stata.html"><a href="Stata.html"><i class="fa fa-check"></i><b>3</b> Stata</a>
<ul>
<li class="chapter" data-level="3.1" data-path="Stata.html"><a href="Stata.html#数据处理"><i class="fa fa-check"></i><b>3.1</b> 数据处理</a></li>
<li class="chapter" data-level="3.2" data-path="Stata.html"><a href="Stata.html#回归相关"><i class="fa fa-check"></i><b>3.2</b> 回归相关</a>
<ul>
<li class="chapter" data-level="3.2.1" data-path="Stata.html"><a href="Stata.html#描述性统计和回归结果导出"><i class="fa fa-check"></i><b>3.2.1</b> 描述性统计和回归结果导出</a></li>
</ul></li>
<li class="chapter" data-level="3.3" data-path="Stata.html"><a href="Stata.html#一些外部命令"><i class="fa fa-check"></i><b>3.3</b> 一些外部命令</a></li>
<li class="chapter" data-level="3.4" data-path="Stata.html"><a href="Stata.html#stata对某个变量随机抽样"><i class="fa fa-check"></i><b>3.4</b> stata对某个变量随机抽样</a></li>
<li class="chapter" data-level="3.5" data-path="Stata.html"><a href="Stata.html#stata调用r"><i class="fa fa-check"></i><b>3.5</b> Stata调用R</a></li>
<li class="chapter" data-level="3.6" data-path="Stata.html"><a href="Stata.html#miscellaneous"><i class="fa fa-check"></i><b>3.6</b> Miscellaneous</a></li>
</ul></li>
<li class="chapter" data-level="4" data-path="Matlab.html"><a href="Matlab.html"><i class="fa fa-check"></i><b>4</b> Matlab</a>
<ul>
<li class="chapter" data-level="4.1" data-path="Matlab.html"><a href="Matlab.html#一句话tips-1"><i class="fa fa-check"></i><b>4.1</b> 一句话Tips</a></li>
<li class="chapter" data-level="4.2" data-path="Matlab.html"><a href="Matlab.html#带名称和缺省值的参数设置"><i class="fa fa-check"></i><b>4.2</b> 带名称和缺省值的参数设置</a></li>
<li class="chapter" data-level="4.3" data-path="Matlab.html"><a href="Matlab.html#窗口输出到文本"><i class="fa fa-check"></i><b>4.3</b> 窗口输出到文本</a></li>
<li class="chapter" data-level="4.4" data-path="Matlab.html"><a href="Matlab.html#gvar-toolbox使用报告"><i class="fa fa-check"></i><b>4.4</b> GVAR Toolbox使用报告</a>
<ul>
<li class="chapter" data-level="4.4.1" data-path="Matlab.html"><a href="Matlab.html#数据输入"><i class="fa fa-check"></i><b>4.4.1</b> 数据输入</a></li>
<li class="chapter" data-level="4.4.2" data-path="Matlab.html"><a href="Matlab.html#模型设定"><i class="fa fa-check"></i><b>4.4.2</b> 模型设定</a></li>
<li class="chapter" data-level="4.4.3" data-path="Matlab.html"><a href="Matlab.html#一些坑"><i class="fa fa-check"></i><b>4.4.3</b> 一些坑</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="5" data-path="git操作流程.html"><a href="git操作流程.html"><i class="fa fa-check"></i><b>5</b> git操作流程</a>
<ul>
<li class="chapter" data-level="5.1" data-path="git操作流程.html"><a href="git操作流程.html#基本语法"><i class="fa fa-check"></i><b>5.1</b> 基本语法</a></li>
<li class="chapter" data-level="5.2" data-path="git操作流程.html"><a href="git操作流程.html#生成公钥"><i class="fa fa-check"></i><b>5.2</b> 生成公钥</a></li>
<li class="chapter" data-level="5.3" data-path="git操作流程.html"><a href="git操作流程.html#本地库操作"><i class="fa fa-check"></i><b>5.3</b> 本地库操作</a></li>
<li class="chapter" data-level="5.4" data-path="git操作流程.html"><a href="git操作流程.html#关联远程库码云"><i class="fa fa-check"></i><b>5.4</b> 关联远程库（码云）</a></li>
<li class="chapter" data-level="5.5" data-path="git操作流程.html"><a href="git操作流程.html#打开vi后的操作"><i class="fa fa-check"></i><b>5.5</b> 打开VI后的操作</a></li>
<li class="chapter" data-level="5.6" data-path="git操作流程.html"><a href="git操作流程.html#给递交进行标记"><i class="fa fa-check"></i><b>5.6</b> 给递交进行标记</a></li>
</ul></li>
<li class="chapter" data-level="6" data-path="C.html"><a href="C.html"><i class="fa fa-check"></i><b>6</b> C语言</a>
<ul>
<li class="chapter" data-level="6.1" data-path="C.html"><a href="C.html#一句话tips-2"><i class="fa fa-check"></i><b>6.1</b> 一句话Tips</a></li>
</ul></li>
<li class="chapter" data-level="7" data-path="Latex.html"><a href="Latex.html"><i class="fa fa-check"></i><b>7</b> Latex</a>
<ul>
<li class="chapter" data-level="7.1" data-path="Latex.html"><a href="Latex.html#一句话tips-3"><i class="fa fa-check"></i><b>7.1</b> 一句话Tips</a></li>
<li class="chapter" data-level="7.2" data-path="Latex.html"><a href="Latex.html#使用pdfpages包插入pdf页面"><i class="fa fa-check"></i><b>7.2</b> 使用<code>pdfpages</code>包插入PDF页面</a></li>
<li class="chapter" data-level="7.3" data-path="Latex.html"><a href="Latex.html#记录几个快捷键"><i class="fa fa-check"></i><b>7.3</b> 记录几个快捷键</a></li>
<li class="chapter" data-level="7.4" data-path="Latex.html"><a href="Latex.html#手动安装新的宏包"><i class="fa fa-check"></i><b>7.4</b> 手动安装新的宏包</a></li>
<li class="chapter" data-level="7.5" data-path="Latex.html"><a href="Latex.html#beamer相关"><i class="fa fa-check"></i><b>7.5</b> <code>beamer</code>相关</a></li>
<li class="chapter" data-level="7.6" data-path="Latex.html"><a href="Latex.html#表格相关"><i class="fa fa-check"></i><b>7.6</b> 表格相关</a>
<ul>
<li class="chapter" data-level="7.6.1" data-path="Latex.html"><a href="Latex.html#长表格"><i class="fa fa-check"></i><b>7.6.1</b> 长表格</a></li>
</ul></li>
<li class="chapter" data-level="7.7" data-path="Latex.html"><a href="Latex.html#章节标题格式修改"><i class="fa fa-check"></i><b>7.7</b> 章节标题格式修改</a></li>
<li class="chapter" data-level="7.8" data-path="Latex.html"><a href="Latex.html#数学公式相关"><i class="fa fa-check"></i><b>7.8</b> 数学公式相关</a>
<ul>
<li class="chapter" data-level="7.8.1" data-path="Latex.html"><a href="Latex.html#数学公式左对齐"><i class="fa fa-check"></i><b>7.8.1</b> 数学公式左对齐</a></li>
</ul></li>
<li class="chapter" data-level="7.9" data-path="Latex.html"><a href="Latex.html#中文字体加粗"><i class="fa fa-check"></i><b>7.9</b> 中文字体加粗</a></li>
<li class="chapter" data-level="7.10" data-path="Latex.html"><a href="Latex.html#使用某种常用字体"><i class="fa fa-check"></i><b>7.10</b> 使用某种常用字体</a>
<ul>
<li class="chapter" data-level="7.10.1" data-path="Latex.html"><a href="Latex.html#如何使用一个新的字体"><i class="fa fa-check"></i><b>7.10.1</b> 如何使用一个新的字体？</a></li>
</ul></li>
<li class="chapter" data-level="7.11" data-path="Latex.html"><a href="Latex.html#我的r代码排版模版"><i class="fa fa-check"></i><b>7.11</b> 我的R代码排版模版</a>
<ul>
<li class="chapter" data-level="7.11.1" data-path="Latex.html"><a href="Latex.html#listings包"><i class="fa fa-check"></i><b>7.11.1</b> <code>listings</code>包</a></li>
<li class="chapter" data-level="7.11.2" data-path="Latex.html"><a href="Latex.html#fancyvrb包"><i class="fa fa-check"></i><b>7.11.2</b> <code>fancyvrb</code>包</a></li>
</ul></li>
<li class="chapter" data-level="7.12" data-path="Latex.html"><a href="Latex.html#latex插入附录"><i class="fa fa-check"></i><b>7.12</b> latex插入附录</a></li>
<li class="chapter" data-level="7.13" data-path="Latex.html"><a href="Latex.html#latex参考文献的编码思路"><i class="fa fa-check"></i><b>7.13</b> latex参考文献的编码思路</a>
<ul>
<li class="chapter" data-level="7.13.1" data-path="Latex.html"><a href="Latex.html#参考文献较少的情况"><i class="fa fa-check"></i><b>7.13.1</b> 参考文献较少的情况</a></li>
<li class="chapter" data-level="7.13.2" data-path="Latex.html"><a href="Latex.html#参考文献较多的情况"><i class="fa fa-check"></i><b>7.13.2</b> 参考文献较多的情况</a></li>
<li class="chapter" data-level="7.13.3" data-path="Latex.html"><a href="Latex.html#如何将文献引用作为上标出现"><i class="fa fa-check"></i><b>7.13.3</b> 如何将文献引用作为上标出现？</a></li>
</ul></li>
<li class="chapter" data-level="7.14" data-path="Latex.html"><a href="Latex.html#一些文体的模版"><i class="fa fa-check"></i><b>7.14</b> 一些文体的模版</a>
<ul>
<li class="chapter" data-level="7.14.1" data-path="Latex.html"><a href="Latex.html#社科申报课题部分模版"><i class="fa fa-check"></i><b>7.14.1</b> 社科申报课题部分模版</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="8" data-path="Blog.html"><a href="Blog.html"><i class="fa fa-check"></i><b>8</b> 博客</a></li>
<li class="chapter" data-level="9" data-path="OS.html"><a href="OS.html"><i class="fa fa-check"></i><b>9</b> macOS操作系统</a>
<ul>
<li class="chapter" data-level="9.1" data-path="OS.html"><a href="OS.html#一句话tips-4"><i class="fa fa-check"></i><b>9.1</b> 一句话Tips</a></li>
<li class="chapter" data-level="9.2" data-path="OS.html"><a href="OS.html#安装和配置latex"><i class="fa fa-check"></i><b>9.2</b> 安装和配置Latex</a></li>
<li class="chapter" data-level="9.3" data-path="OS.html"><a href="OS.html#homebrew"><i class="fa fa-check"></i><b>9.3</b> Homebrew</a></li>
<li class="chapter" data-level="9.4" data-path="OS.html"><a href="OS.html#挂载外置磁盘"><i class="fa fa-check"></i><b>9.4</b> 挂载外置磁盘</a></li>
</ul></li>
<li class="chapter" data-level="10" data-path="Mathematica.html"><a href="Mathematica.html"><i class="fa fa-check"></i><b>10</b> Mathematica</a>
<ul>
<li class="chapter" data-level="10.1" data-path="Mathematica.html"><a href="Mathematica.html#快捷键-1"><i class="fa fa-check"></i><b>10.1</b> 快捷键</a></li>
</ul></li>
<li class="chapter" data-level="11" data-path="Python.html"><a href="Python.html"><i class="fa fa-check"></i><b>11</b> python</a>
<ul>
<li class="chapter" data-level="11.1" data-path="Python.html"><a href="Python.html#vscode下配置python"><i class="fa fa-check"></i><b>11.1</b> VSCode下配置python</a></li>
</ul></li>
<li class="chapter" data-level="12" data-path="Other.html"><a href="Other.html"><i class="fa fa-check"></i><b>12</b> 其他小众软件</a>
<ul>
<li class="chapter" data-level="12.1" data-path="Other.html"><a href="Other.html#pdf文件压缩"><i class="fa fa-check"></i><b>12.1</b> PDF文件压缩</a></li>
<li class="chapter" data-level="12.2" data-path="Other.html"><a href="Other.html#eviews编程"><i class="fa fa-check"></i><b>12.2</b> Eviews编程</a></li>
<li class="chapter" data-level="12.3" data-path="Other.html"><a href="Other.html#gauss"><i class="fa fa-check"></i><b>12.3</b> GAUSS</a>
<ul>
<li class="chapter" data-level="12.3.1" data-path="Other.html"><a href="Other.html#系统函数"><i class="fa fa-check"></i><b>12.3.1</b> 系统函数</a></li>
</ul></li>
<li class="chapter" data-level="12.4" data-path="Other.html"><a href="Other.html#zotero"><i class="fa fa-check"></i><b>12.4</b> Zotero</a></li>
<li class="chapter" data-level="12.5" data-path="Other.html"><a href="Other.html#word中插入公式"><i class="fa fa-check"></i><b>12.5</b> Word中插入公式</a>
<ul>
<li class="chapter" data-level="12.5.1" data-path="Other.html"><a href="Other.html#自带的公式输入"><i class="fa fa-check"></i><b>12.5.1</b> 自带的公式输入</a></li>
<li class="chapter" data-level="12.5.2" data-path="Other.html"><a href="Other.html#公式编号的其他方法"><i class="fa fa-check"></i><b>12.5.2</b> 公式编号的其他方法</a></li>
<li class="chapter" data-level="12.5.3" data-path="Other.html"><a href="Other.html#利用texsword编辑器"><i class="fa fa-check"></i><b>12.5.3</b> 利用TexsWord编辑器</a></li>
</ul></li>
<li class="chapter" data-level="12.6" data-path="Other.html"><a href="Other.html#noteexpress样式设置"><i class="fa fa-check"></i><b>12.6</b> NoteExpress样式设置</a></li>
<li class="chapter" data-level="12.7" data-path="Other.html"><a href="Other.html#filezilla"><i class="fa fa-check"></i><b>12.7</b> FileZilla</a></li>
</ul></li>
<li class="chapter" data-level="" data-path="references.html"><a href="references.html"><i class="fa fa-check"></i>References</a></li>
</ul>

      </nav>
    </div>

    <div class="book-body">
      <div class="body-inner">
        <div class="book-header" role="navigation">
          <h1>
            <i class="fa fa-circle-o-notch fa-spin"></i><a href="./">编程语言笔记</a>
          </h1>
        </div>

        <div class="page-wrapper" tabindex="-1" role="main">
          <div class="page-inner">

            <section class="normal" id="section-">
<div id="Latex" class="section level1 hasAnchor" number="7">
<h1><span class="header-section-number">7</span> Latex<a href="Latex.html#Latex" class="anchor-section" aria-label="Anchor link to header"></a></h1>
<div id="一句话tips-3" class="section level2 hasAnchor" number="7.1">
<h2><span class="header-section-number">7.1</span> 一句话Tips<a href="Latex.html#一句话tips-3" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<ul>
<li>使用TikZ画图，可以如下定义缩放参数</li>
</ul>
<div class="sourceCode" id="cb42"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb42-1"><a href="Latex.html#cb42-1" tabindex="-1"></a><span class="fu">\tikzset</span>{global scale/.style={</span>
<span id="cb42-2"><a href="Latex.html#cb42-2" tabindex="-1"></a>    scale=#1,</span>
<span id="cb42-3"><a href="Latex.html#cb42-3" tabindex="-1"></a>    every node/.append style={scale=#1}</span>
<span id="cb42-4"><a href="Latex.html#cb42-4" tabindex="-1"></a>  }</span>
<span id="cb42-5"><a href="Latex.html#cb42-5" tabindex="-1"></a>}</span></code></pre></div>
<p>然后如下使用即可，</p>
<div class="sourceCode" id="cb43"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb43-1"><a href="Latex.html#cb43-1" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">tikzpicture</span>}[global scale = 2]<span class="co">%扩大两倍</span></span>
<span id="cb43-2"><a href="Latex.html#cb43-2" tabindex="-1"></a>...</span>
<span id="cb43-3"><a href="Latex.html#cb43-3" tabindex="-1"></a><span class="kw">\end</span>{<span class="ex">tikzpicture</span>}</span></code></pre></div>
<ul>
<li>包<code>fontawesome5</code>提供了大量的有趣的小图标。如<code>\faComments</code>是微信图标，<code>\faMobile</code>是手机图标，<code>\faGlobe</code>是网络图标等。它也支持改变图标颜色。</li>
<li>设置目录的表现格式。<code>titletoc</code>包中<code>\titlecontents{subsubsection}[8.5em]{}{\contentslabel{1.5em}}{}{\titlerule*[5pt]{$\cdot$}\contentspage}</code>设置目录中<code>subsubsection</code>的表现格式，8.5em指的是subsubsection的标题内容离页面最左边距离8.5em，<code>\contentslabel{1.5em}</code>中的<code>1.5em</code>指的标题序号比如<code>1</code>和标题内容之间的空白是1.5em。</li>
<li><code>book</code>类默认左边留白，可以<code>\documentclass[openany]{book}</code>左边不留白。</li>
<li>使用<code>include</code>后不分页，可以</li>
</ul>
<div class="sourceCode" id="cb44"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb44-1"><a href="Latex.html#cb44-1" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">newclude</span>}</span>
<span id="cb44-2"><a href="Latex.html#cb44-2" tabindex="-1"></a><span class="fu">\include*</span>{filepath/filename}</span></code></pre></div>
<ul>
<li>页面横置：</li>
</ul>
<div class="sourceCode" id="cb45"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb45-1"><a href="Latex.html#cb45-1" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">pdflscape</span>}</span>
<span id="cb45-2"><a href="Latex.html#cb45-2" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">document</span>}</span>
<span id="cb45-3"><a href="Latex.html#cb45-3" tabindex="-1"></a></span>
<span id="cb45-4"><a href="Latex.html#cb45-4" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">landscape</span>}</span>
<span id="cb45-5"><a href="Latex.html#cb45-5" tabindex="-1"></a>This is a landscape page.</span>
<span id="cb45-6"><a href="Latex.html#cb45-6" tabindex="-1"></a><span class="kw">\end</span>{<span class="ex">landscape</span>}</span>
<span id="cb45-7"><a href="Latex.html#cb45-7" tabindex="-1"></a></span>
<span id="cb45-8"><a href="Latex.html#cb45-8" tabindex="-1"></a><span class="kw">\end</span>{<span class="ex">document</span>}</span></code></pre></div>
<ul>
<li>在命令行输入<code>texcount your_tex_file.tex</code>可以计数文件中的字符。</li>
<li>让表格从4开始编号<code>\setcounter{table}{3}</code>，让页码重新编号<code>\setcounter{page}{3}</code>，以此类推。</li>
<li><code>xpinyin</code>包可以生成拼音，比如<code>\xpinyin*{好}</code>可以在其上方产生拼音，也可以自己设拼音，还可以设环境。可以参见其说明文档，是中文的。</li>
<li>用<code>tikz</code>包可以生成PDF图片，此时可以在命令行用<code>pdftocairo -svg picture.pdf</code>将这个pdf文件转成SVG 格式的矢量图，只要安装了texlive就会有pdftocairo命令。再利用Visio将其转换成word可以用的wmf格式的矢量图。</li>
<li>设置目录的深度，一般两个命令。仅用第一个命令会使得更深的目录缺乏编号。</li>
</ul>
<div class="sourceCode" id="cb46"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb46-1"><a href="Latex.html#cb46-1" tabindex="-1"></a><span class="fu">\setcounter</span>{tocdepth}{4} <span class="co">% 控制目录显示的深度</span></span>
<span id="cb46-2"><a href="Latex.html#cb46-2" tabindex="-1"></a><span class="fu">\setcounter</span>{secnumdepth}{3} <span class="co">% 控制目录显示的深度中，前面编号的显示深度。</span></span></code></pre></div>
<ul>
<li>latex也可以写循环。加载<code>multido</code>包,如下语句表示从3开始，每次变量自增1，循环16次。这是把一个PDF文件拆分成单独的页面后加入latex的一个常见操作。</li>
</ul>
<div class="sourceCode" id="cb47"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb47-1"><a href="Latex.html#cb47-1" tabindex="-1"></a><span class="fu">\multido</span>{<span class="fu">\n</span>=3+1}{16}{<span class="fu">\noindent\includegraphics</span>[scale=0.9]{RD复印 <span class="fu">\n</span>.pdf}<span class="fu">\\</span>}</span></code></pre></div>
<ul>
<li>定制封面页时，要使第一行下沉几行，可以这样：</li>
</ul>
<div class="sourceCode" id="cb48"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb48-1"><a href="Latex.html#cb48-1" tabindex="-1"></a> <span class="fu">\hspace</span>{2em}</span>
<span id="cb48-2"><a href="Latex.html#cb48-2" tabindex="-1"></a> </span>
<span id="cb48-3"><a href="Latex.html#cb48-3" tabindex="-1"></a> <span class="fu">\vspace</span>{4em}  </span>
<span id="cb48-4"><a href="Latex.html#cb48-4" tabindex="-1"></a>    <span class="kw">\begin</span>{<span class="ex">center</span>}      </span>
<span id="cb48-5"><a href="Latex.html#cb48-5" tabindex="-1"></a><span class="fu">\heiti\zihao</span>{1} 江西省第十九次社会科学优秀成果奖附件材料        </span>
<span id="cb48-6"><a href="Latex.html#cb48-6" tabindex="-1"></a>    <span class="kw">\end</span>{<span class="ex">center</span>}</span></code></pre></div>
<ul>
<li><p>使用<code>listing</code>包输入代码时，很多时候我都是输入R语言，R语言里面会有一个美元符号，我们需要将这个符号“逃逸”，即在选项中设置<code>[mathescape=false]</code>。关于逃逸，更多细节可以见包的说明文档。</p></li>
<li><p>小写罗马字母，</p></li>
</ul>
<div class="sourceCode" id="cb49"><pre class="sourceCode latex"><code class="sourceCode latex"><span id="cb49-1"><a href="Latex.html#cb49-1" tabindex="-1"></a><span class="co">% 小写罗马字母\rmnum{2}</span></span>
<span id="cb49-2"><a href="Latex.html#cb49-2" tabindex="-1"></a><span class="fu">\newcommand</span>{<span class="ex">\rmnum</span>}[1]{<span class="fu">\romannumeral</span> #1}</span>
<span id="cb49-3"><a href="Latex.html#cb49-3" tabindex="-1"></a><span class="co">% 大写罗马字母\Rmnum{2}</span></span>
<span id="cb49-4"><a href="Latex.html#cb49-4" tabindex="-1"></a><span class="fu">\newcommand</span>{<span class="ex">\Rmnum</span>}[1]{<span class="fu">\uppercase\expandafter</span>{<span class="fu">\romannumeral</span> #1}}</span></code></pre></div>
<ul>
<li><code>pifont</code>包的<code>\ding{172}</code>提供了带圈的1的数字。</li>
<li>可定义如下环境给某段文字加上上下边框双横线，比如我在审稿意见中经常使用。</li>
</ul>
<div class="sourceCode" id="cb50"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb50-1"><a href="Latex.html#cb50-1" tabindex="-1"></a><span class="fu">\newenvironment</span>{myequestion}{<span class="fu">\noindent\makebox</span>[0pt][l]{<span class="fu">\rule</span>[-1.5mm]{45em}{0.5pt}}<span class="fu">\rule</span>[-0.7mm]{45em}{0.5pt}<span class="fu">\par</span>}{<span class="fu">\par</span> <span class="fu">\noindent\makebox</span>[0pt][l]{<span class="fu">\rule</span>[3mm]{45em}{0.5pt}}<span class="fu">\rule</span>[3.8mm]{45em}{0.5pt}<span class="fu">\par</span>}</span></code></pre></div>
<ul>
<li><p>给中文加下划线、波浪线等，用<code>xeCJKfntef</code>包，这样使用<code>\CJKunderline</code>或者<code>\CJKunderwave</code>等命令加了下划线等就能自动换行。</p></li>
<li><p>页面横置</p></li>
</ul>
<div class="sourceCode" id="cb51"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb51-1"><a href="Latex.html#cb51-1" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">pdflscape</span>}</span>
<span id="cb51-2"><a href="Latex.html#cb51-2" tabindex="-1"></a></span>
<span id="cb51-3"><a href="Latex.html#cb51-3" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">landscape</span>}</span>
<span id="cb51-4"><a href="Latex.html#cb51-4" tabindex="-1"></a>...</span>
<span id="cb51-5"><a href="Latex.html#cb51-5" tabindex="-1"></a><span class="kw">\end</span>{<span class="ex">landscape</span>}</span></code></pre></div>
<ul>
<li><p>在命令行输入<code>texdoc ctex</code>会打开<code>ctex</code>包的说明文件。</p></li>
<li><p><code>input/output</code>就不会在斜杠符号处被断词。如果希望这类东西被中断，可以将斜杠符号改为<code>\slash</code>。</p></li>
<li><p>下载TexLive作为Tex的内核，而不是ctex，因为前者不断在更新，更加优化。</p></li>
<li><p>中文标签乱码：使用如下选项即可。</p></li>
</ul>
<div class="sourceCode" id="cb52"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb52-1"><a href="Latex.html#cb52-1" tabindex="-1"></a><span class="bu">\documentclass</span>[hyperref, UTF8]{<span class="ex">ctexart</span>}</span></code></pre></div>
<ul>
<li>图片文件名包含下划线，可用<code>\string“ 17_Huadong\string”</code>表达。如</li>
</ul>
<p><code>\includegraphics[scale=0.8]{\string"E:/17_HuaDong/reserch/GVAR/RltPaper/DesStat\string".png}</code></p>
<ul>
<li><p>使用<code>\verb||</code>时，如果是在其他命令中作为参数使用，是会报错的。例如<code>\footnote{\verb|abc|}</code>是不行的。应该加载<code>fancyvrb</code>包，然后先保存<code>\SaveVerb{myverb}|abc|</code>，再使用<code>\footnote{\UseVerb{myverb}}</code>即可。</p></li>
<li><p><code>\renewcommand\refname{Reference}</code>把“参考文献”四个字修改为“Reference”</p></li>
<li><p><code>\rule[水平高度]{长度}{粗细}</code>，文档中插入一条横线。如<code>\rule[0mm]{55em}{0.5mm}</code></p></li>
<li><p>使用<code>framed</code>包，用<code>\begin{framed}\end{framed}</code>环境可以给整段文字加边框。</p></li>
<li><p><code>\pagestyle{empty}</code>当前及后续页无页眉,第一页因为包含标题等可能有特殊格式，要消掉它的页码的话则用<code>\thispagestyle{empty}</code>。但如果还是无法去除第一页的页码，一定是使用了<code>\maketitle</code>命令，该命令内部调用了<code>\thispagestyle{\plain}</code>，为了解决这个问题，只要在该命令行里面调用<code>\thispagestyle{\empty}</code>，空行也不要留下。</p></li>
<li><p><code>\renewcommand\refname{参考文献}</code>把”Reference”变成“参考文献”。</p></li>
</ul>
</div>
<div id="使用pdfpages包插入pdf页面" class="section level2 hasAnchor" number="7.2">
<h2><span class="header-section-number">7.2</span> 使用<code>pdfpages</code>包插入PDF页面<a href="Latex.html#使用pdfpages包插入pdf页面" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<ul>
<li>命令比如：<code>\includepdf[pages={1,2}]{1.pdf}</code>就是插入这个PDF文件的第1和第二页</li>
<li>有时页面插入后可能会往右偏了点，可以使用命令<code>\includepdf[offset=-3em  0]{tb1.pdf}</code>把页面往左移，那个“0”表示在垂直方向不需要移。</li>
</ul>
</div>
<div id="记录几个快捷键" class="section level2 hasAnchor" number="7.3">
<h2><span class="header-section-number">7.3</span> 记录几个快捷键<a href="Latex.html#记录几个快捷键" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<ul>
<li>command + 方向右键： 跳至行尾。实际上，你可以更改为End键，在“偏好——快捷键”，然后右边的栏目中第三个大类，“编辑器——基本键映射”中更改即可。</li>
<li>command + 方向左键： 跳至行首。</li>
<li>alt + 方向右键： 往后跳了到下一个标点符号</li>
<li>alt + 方向左键： 往前跳了到上一个标点符号</li>
</ul>
</div>
<div id="手动安装新的宏包" class="section level2 hasAnchor" number="7.4">
<h2><span class="header-section-number">7.4</span> 手动安装新的宏包<a href="Latex.html#手动安装新的宏包" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>可在网站（<a href="https://www.ctan.org/pkg）找到需要的宏包，或者自己写的宏包，该宏包是一个文件夹，该文件夹下要包含有一个" class="uri">https://www.ctan.org/pkg）找到需要的宏包，或者自己写的宏包，该宏包是一个文件夹，该文件夹下要包含有一个</a><code>.sty</code>文件。然后把这个文件夹整个复制到路径<code>usr/local/texlive/2021/texmf-dist/tex/latex/</code>下面（这是Mac系统的路径），可以看到这里面包含了所有的安装宏包。最后在命令行运行：</p>
<pre><code>sudo mktexlsr
sudo texhash</code></pre>
<p>此时就可以像往常一样调用tex的宏包了。</p>
</div>
<div id="beamer相关" class="section level2 hasAnchor" number="7.5">
<h2><span class="header-section-number">7.5</span> <code>beamer</code>相关<a href="Latex.html#beamer相关" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<ul>
<li>在beamer中加入Logo的话，在<code>\begin{documents}</code>之后使用如下命令<code>\logo{\includegraphics[height=1.5cm]{RM.jpg}}</code>。Logo的位置取决于模板。</li>
<li>如何在beamer中设置颜色？使用普通的color包或者xcolor包都会报错，它有自己的一套办法。</li>
</ul>
<div class="sourceCode" id="cb54"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb54-1"><a href="Latex.html#cb54-1" tabindex="-1"></a><span class="co">% 首先设置好颜色，并命名为myblue</span></span>
<span id="cb54-2"><a href="Latex.html#cb54-2" tabindex="-1"></a><span class="fu">\setbeamercolor</span>{myblue}{fg=blue!80!black} <span class="co">% 这是以感叹作为分隔符的三色设置</span></span>
<span id="cb54-3"><a href="Latex.html#cb54-3" tabindex="-1"></a><span class="co">% 然后在需要的地方使用</span></span>
<span id="cb54-4"><a href="Latex.html#cb54-4" tabindex="-1"></a><span class="fu">\textbf</span>{<span class="fu">\usebeamercolor</span>[fg]{myblue}背景}</span></code></pre></div>
<ul>
<li>beamer中也是可以插入代码的，可以使用<code>listings</code>包，不过在使用代码的那个<code>frame</code>必须要加一个选项<code>[fragile]</code>。</li>
<li>bemaer中可以分栏，载入包<code>multicol</code>，使用<code>\begin{multicols}{2}巴拉巴拉\end{multicols}</code>就是2栏。</li>
</ul>
</div>
<div id="表格相关" class="section level2 hasAnchor" number="7.6">
<h2><span class="header-section-number">7.6</span> 表格相关<a href="Latex.html#表格相关" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<ul>
<li>表格换行，可以添加<code>makecell</code>包后，使用<code>\makecell[居中情况]{第1行内容 \\ 第2行内容 \\ 第3行内容 ...}</code>形式即可。</li>
<li>给表格添加颜色，载入<code>colorbl</code>包，<code>\cellcolor[gray]{.7}</code>设置单元格颜色，<code>\rowcolor[gray]{0.7}</code>设置行颜色，列颜色设置可以参见胡伟(2013, p231)。</li>
<li>表头添加一根斜线，使用<code>diagbox</code>包，例如，</li>
</ul>
<div class="sourceCode" id="cb55"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb55-1"><a href="Latex.html#cb55-1" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">diagbox</span>}</span>
<span id="cb55-2"><a href="Latex.html#cb55-2" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">document</span>}</span>
<span id="cb55-3"><a href="Latex.html#cb55-3" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">tabular</span>}{|c|c|c|c|}</span>
<span id="cb55-4"><a href="Latex.html#cb55-4" tabindex="-1"></a>    <span class="fu">\hline</span></span>
<span id="cb55-5"><a href="Latex.html#cb55-5" tabindex="-1"></a>    <span class="fu">\diagbox</span>{姓名}{成绩}{科目} <span class="op">&amp;</span> 语文 <span class="op">&amp;</span> 英语 <span class="op">&amp;</span> 数学<span class="fu">\\</span> <span class="fu">\hline</span></span>
<span id="cb55-6"><a href="Latex.html#cb55-6" tabindex="-1"></a>    张三 <span class="op">&amp;</span> 87 <span class="op">&amp;</span> 66 <span class="op">&amp;</span> 98 <span class="fu">\\</span> <span class="fu">\hline</span></span>
<span id="cb55-7"><a href="Latex.html#cb55-7" tabindex="-1"></a>    李四 <span class="op">&amp;</span> 78 <span class="op">&amp;</span> 78 <span class="op">&amp;</span> 76 <span class="fu">\\</span> <span class="fu">\hline</span></span>
<span id="cb55-8"><a href="Latex.html#cb55-8" tabindex="-1"></a>    王五 <span class="op">&amp;</span> 90 <span class="op">&amp;</span> 93 <span class="op">&amp;</span> 81 <span class="fu">\\</span> <span class="fu">\hline</span></span>
<span id="cb55-9"><a href="Latex.html#cb55-9" tabindex="-1"></a><span class="kw">\end</span>{<span class="ex">tabular</span>}</span>
<span id="cb55-10"><a href="Latex.html#cb55-10" tabindex="-1"></a><span class="kw">\end</span>{<span class="ex">document</span>}</span></code></pre></div>
<ul>
<li><p>调整表格的行高，使用<code>array</code>包的<code>\renewcommand{\arraystretch}{2}</code>更佳，默认是1，它表示行与行之间的距离系数是1。该命令放在<code>\begin{table}</code>之后即可。</p></li>
<li><p><code>\cline{2-4}</code>紧跟在<code>\\</code>后，表示表格中从第2列至第4列划一条横线</p></li>
<li><p>表格跨行使用<code>multirow</code>包。语法命令格式如下，</p></li>
</ul>
<div class="sourceCode" id="cb56"><pre class="sourceCode latex"><code class="sourceCode latex"><span id="cb56-1"><a href="Latex.html#cb56-1" tabindex="-1"></a><span class="fu">\multirow</span>{行数}{宽度}{内容}</span>
<span id="cb56-2"><a href="Latex.html#cb56-2" tabindex="-1"></a><span class="fu">\multirow</span>{行数}*{内容} </span>
<span id="cb56-3"><a href="Latex.html#cb56-3" tabindex="-1"></a><span class="co">% 跨行跨列的话，要嵌套在\multicolumn中</span></span>
<span id="cb56-4"><a href="Latex.html#cb56-4" tabindex="-1"></a><span class="fu">\multicolumn</span>{列数}{位置}{<span class="fu">\multirow</span>{行数}{宽度}{内容}}</span></code></pre></div>
<div id="长表格" class="section level3 hasAnchor" number="7.6.1">
<h3><span class="header-section-number">7.6.1</span> 长表格<a href="Latex.html#长表格" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<div class="sourceCode" id="cb57"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb57-1"><a href="Latex.html#cb57-1" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">supertabular</span>}</span>
<span id="cb57-2"><a href="Latex.html#cb57-2" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">center</span>}</span>
<span id="cb57-3"><a href="Latex.html#cb57-3" tabindex="-1"></a><span class="fu">\small</span></span>
<span id="cb57-4"><a href="Latex.html#cb57-4" tabindex="-1"></a>    <span class="fu">\tablecaption</span>{变量描述<span class="fu">\label</span>{var}}</span>
<span id="cb57-5"><a href="Latex.html#cb57-5" tabindex="-1"></a>    <span class="fu">\tablefirsthead</span>{<span class="fu">\hline\multicolumn</span>{1}{c}{变量}&amp;<span class="fu">\multicolumn</span>{1}{c}{含义}&amp;<span class="fu">\multicolumn</span>{1}{c}{2018年变量编码}&amp;<span class="fu">\multicolumn</span>{1}{c}{2016年变量编码}&amp;<span class="fu">\multicolumn</span>{1}{c}{2014年变量编码}&amp;<span class="fu">\multicolumn</span>{1}{c}{2010年变量编码}<span class="fu">\\\hline</span>}</span>
<span id="cb57-6"><a href="Latex.html#cb57-6" tabindex="-1"></a>    <span class="fu">\tablehead</span>{<span class="fu">\multicolumn</span>{6}{r}{表 <span class="kw">\ref</span>{<span class="ex">var</span>} (续)}<span class="fu">\\\hline</span></span>
<span id="cb57-7"><a href="Latex.html#cb57-7" tabindex="-1"></a>    <span class="fu">\multicolumn</span>{1}{l}{变量}&amp;<span class="fu">\multicolumn</span>{1}{l}{含义}&amp;<span class="fu">\multicolumn</span>{1}{l}{2018年变量编码}&amp;<span class="fu">\multicolumn</span>{1}{l}{2016年变量编码}&amp;<span class="fu">\multicolumn</span>{1}{l}{2014年变量编码}&amp;<span class="fu">\multicolumn</span>{1}{l}{2010年变量编码}<span class="fu">\\\hline</span>}</span>
<span id="cb57-8"><a href="Latex.html#cb57-8" tabindex="-1"></a><span class="fu">\tabletail</span>{<span class="fu">\hline</span>}</span>
<span id="cb57-9"><a href="Latex.html#cb57-9" tabindex="-1"></a>    <span class="kw">\begin</span>{<span class="ex">supertabular</span>}{lllllp{10mm}}</span>
<span id="cb57-10"><a href="Latex.html#cb57-10" tabindex="-1"></a>withsons <span class="op">&amp;</span> 同子女关系如何 <span class="op">&amp;</span> qf1<span class="fu">\_</span>a<span class="fu">\_</span>1 <span class="op">&amp;</span> qf1<span class="fu">\_</span>a<span class="fu">\_</span>1 <span class="op">&amp;</span>  <span class="op">&amp;</span> qf1<span class="fu">\_</span>a<span class="fu">\_</span>1<span class="fu">\\</span></span>
<span id="cb57-11"><a href="Latex.html#cb57-11" tabindex="-1"></a>        worktime <span class="op">&amp;</span> 每周工作时间（小时） <span class="op">&amp;</span> qg6   <span class="op">&amp;</span> qg6   <span class="op">&amp;</span> qg6 <span class="op">&amp;</span>qg504<span class="fu">\\</span>    </span>
<span id="cb57-12"><a href="Latex.html#cb57-12" tabindex="-1"></a>        <span class="kw">\end</span>{<span class="ex">supertabular</span>}</span></code></pre></div>
<p>注意三个参数：</p>
<ul>
<li><code>\tablecaption{}</code>:整个表格标题</li>
<li><code>\tablefirsthead{}</code>:首页表格标题</li>
<li><code>\tablehead{}</code>:续页表格标题</li>
<li><code>\tabletail{}</code>:分页时表格底部写啥，一根线就直接用<code>\hline</code>
排版效果如下：见有道截图</li>
</ul>
<p>长表格的一个最大优点就是可以跨页排版，有时不用那么复杂，只需要使用<code>\endfirsthead</code>命令来结束表头，其他与普通表格一致即可达到想要的效果。如，</p>
<div class="sourceCode" id="cb58"><pre class="sourceCode latex"><code class="sourceCode latex"><span id="cb58-1"><a href="Latex.html#cb58-1" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">longtable</span>}</span>
<span id="cb58-2"><a href="Latex.html#cb58-2" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">longtable</span>}{c|c}</span>
<span id="cb58-3"><a href="Latex.html#cb58-3" tabindex="-1"></a>    <span class="fu">\caption</span>{内生性分析}<span class="fu">\\\hline\endfirsthead</span></span>
<span id="cb58-4"><a href="Latex.html#cb58-4" tabindex="-1"></a>    A<span class="op">&amp;</span>B<span class="fu">\\</span></span>
<span id="cb58-5"><a href="Latex.html#cb58-5" tabindex="-1"></a>    C<span class="op">&amp;</span>D</span>
<span id="cb58-6"><a href="Latex.html#cb58-6" tabindex="-1"></a>    <span class="kw">\end</span>{<span class="ex">longtable</span>}</span></code></pre></div>
</div>
</div>
<div id="章节标题格式修改" class="section level2 hasAnchor" number="7.7">
<h2><span class="header-section-number">7.7</span> 章节标题格式修改<a href="Latex.html#章节标题格式修改" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<ul>
<li>如果想从某页开始章节重新编号，可以在该处输入命令，</li>
</ul>
<div class="sourceCode" id="cb59"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb59-1"><a href="Latex.html#cb59-1" tabindex="-1"></a><span class="fu">\setcounter</span>{section}{0} <span class="co">% 下一节编号为1</span></span></code></pre></div>
<ul>
<li>修改章节的标题，把”Chapter 1”变成”第1章”。</li>
</ul>
<div class="sourceCode" id="cb60"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb60-1"><a href="Latex.html#cb60-1" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">titlesec</span>}</span>
<span id="cb60-2"><a href="Latex.html#cb60-2" tabindex="-1"></a><span class="co">% \titleformat{command}[shape]{format}{label}{sep}{before}[after]</span></span>
<span id="cb60-3"><a href="Latex.html#cb60-3" tabindex="-1"></a><span class="fu">\titleformat</span>{<span class="kw">\chapter</span>}{<span class="fu">\centering\Huge\bfseries</span>}{第<span class="fu">\,\thechapter\,</span>章}{1em}{}</span></code></pre></div>
<ul>
<li>“Chapter 1”变成”一”。但调用<code>ctexcap</code>包，则不能调用<code>titlesec</code>和<code>ctex</code>包和这些包的命令，这些包的调用都会隐含在<code>ctexcap</code>包中。</li>
</ul>
<div class="sourceCode" id="cb61"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb61-1"><a href="Latex.html#cb61-1" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">ctexcap</span>}</span>
<span id="cb61-2"><a href="Latex.html#cb61-2" tabindex="-1"></a><span class="fu">\CTEXsetup</span>[number={<span class="fu">\chinese</span>{section}}, format + = {<span class="fu">\fangsong\zihao</span>{4}}]{section}</span>
<span id="cb61-3"><a href="Latex.html#cb61-3" tabindex="-1"></a><span class="fu">\CTEXsetup</span>[name ={（,）},aftername = {<span class="fu">\hspace</span>{0em}},number={<span class="fu">\chinese</span>{subsection}}, </span>
<span id="cb61-4"><a href="Latex.html#cb61-4" tabindex="-1"></a>format + = {<span class="fu">\heiti\zihao</span>{-4}}]{subsection} <span class="co">% 小节标题变成(一)</span></span>
<span id="cb61-5"><a href="Latex.html#cb61-5" tabindex="-1"></a><span class="fu">\CTEXsetup</span>[number={<span class="fu">\the\value</span>{subsubsection}}, </span>
<span id="cb61-6"><a href="Latex.html#cb61-6" tabindex="-1"></a>format + = {<span class="fu">\songti\zihao</span>{5}}]{subsubsection} <span class="co">% 第三层标题变成 1，2，...</span></span></code></pre></div>
<ul>
<li>一个整体地中文修改参考如下</li>
</ul>
<div class="sourceCode" id="cb62"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb62-1"><a href="Latex.html#cb62-1" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">titlesec</span>}</span>
<span id="cb62-2"><a href="Latex.html#cb62-2" tabindex="-1"></a><span class="fu">\newcommand</span>{<span class="ex">\sectionname</span>}{节}</span>
<span id="cb62-3"><a href="Latex.html#cb62-3" tabindex="-1"></a><span class="fu">\renewcommand</span>{<span class="ex">\figurename</span>}{图}</span>
<span id="cb62-4"><a href="Latex.html#cb62-4" tabindex="-1"></a><span class="fu">\renewcommand</span>{<span class="ex">\tablename</span>}{表}</span>
<span id="cb62-5"><a href="Latex.html#cb62-5" tabindex="-1"></a><span class="fu">\renewcommand</span>{<span class="ex">\bibname</span>}{参考文献}</span>
<span id="cb62-6"><a href="Latex.html#cb62-6" tabindex="-1"></a><span class="fu">\renewcommand</span>{<span class="ex">\contentsname</span>}{目~录}</span>
<span id="cb62-7"><a href="Latex.html#cb62-7" tabindex="-1"></a><span class="fu">\renewcommand</span>{<span class="ex">\listfigurename</span>}{图~目~录}</span>
<span id="cb62-8"><a href="Latex.html#cb62-8" tabindex="-1"></a><span class="fu">\renewcommand</span>{<span class="ex">\listtablename</span>}{表~目~录}</span>
<span id="cb62-9"><a href="Latex.html#cb62-9" tabindex="-1"></a><span class="fu">\renewcommand</span>{<span class="ex">\indexname</span>}{索~引}</span>
<span id="cb62-10"><a href="Latex.html#cb62-10" tabindex="-1"></a><span class="fu">\renewcommand</span>{<span class="ex">\abstractname</span>}{<span class="fu">\Large</span>{摘~要}}</span>
<span id="cb62-11"><a href="Latex.html#cb62-11" tabindex="-1"></a><span class="fu">\newcommand</span>{<span class="ex">\keywords</span>}[1]{<span class="fu">\\</span> <span class="fu">\\</span> <span class="fu">\textbf</span>{关~键~词}：#1}</span>
<span id="cb62-12"><a href="Latex.html#cb62-12" tabindex="-1"></a><span class="fu">\titleformat</span>{<span class="kw">\chapter</span>}[block]{<span class="fu">\center\Large\bf</span>}{<span class="fu">\chaptername</span>}{20pt}{}</span>
<span id="cb62-13"><a href="Latex.html#cb62-13" tabindex="-1"></a><span class="fu">\titleformat</span>{<span class="kw">\section</span>}[block]{<span class="fu">\large\bf</span>}{<span class="fu">\thesection</span>}{10pt}{}</span></code></pre></div>
</div>
<div id="数学公式相关" class="section level2 hasAnchor" number="7.8">
<h2><span class="header-section-number">7.8</span> 数学公式相关<a href="Latex.html#数学公式相关" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>如果公式很长，恰好处在跨页处，默认会把公式全部移到新一页，上一页留下空白。如果不想这样，而是跨页排版公式，则可在导言处使用<code>\allowdisplaybreaks[4]</code>，这个<code>4</code>代表的数字意义在于数值越大，执行跨页的强度越大。</p>
<div id="数学公式左对齐" class="section level3 hasAnchor" number="7.8.1">
<h3><span class="header-section-number">7.8.1</span> 数学公式左对齐<a href="Latex.html#数学公式左对齐" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>如果我们想要全文行间公式(display) 均左对齐，我们有三个方法如下：</p>
<ul>
<li><p>使用<code>\documentclass[fleqn]{article}</code>对整篇文章有效。</p></li>
<li><p>加载宏包amsmath时，设置fleqn参数<code>\usepackage[fleqn]{amsmath}</code>。</p></li>
</ul>
<p>上述方法选其一即可实现左对齐，但这个情况有需要注意的地方：</p>
<p>我们使用了fleqn, 当且仅当使用这一参数的时候，行间公式默认有一个缩进mathindent，其值系统定义为27.37506pt minus 27.37506pt 若是我们不想要这个缩进，可以用<code>\setlength{\mathindent}{0pt}</code>将其缩进设置为0pt。</p>
<ul>
<li>如果我们仅仅希望部分公式左对齐，则可以采用下述方法</li>
</ul>
<div class="sourceCode" id="cb63"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb63-1"><a href="Latex.html#cb63-1" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">flalign</span>}</span>
<span id="cb63-2"><a href="Latex.html#cb63-2" tabindex="-1"></a></span>
<span id="cb63-3"><a href="Latex.html#cb63-3" tabindex="-1"></a><span class="ss">&amp;</span><span class="sc">\text</span>{your equation}<span class="ss">&amp;</span></span>
<span id="cb63-4"><a href="Latex.html#cb63-4" tabindex="-1"></a></span>
<span id="cb63-5"><a href="Latex.html#cb63-5" tabindex="-1"></a><span class="kw">\end</span>{<span class="ex">flalign</span>}</span></code></pre></div>
</div>
</div>
<div id="中文字体加粗" class="section level2 hasAnchor" number="7.9">
<h2><span class="header-section-number">7.9</span> 中文字体加粗<a href="Latex.html#中文字体加粗" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<div class="sourceCode" id="cb64"><pre class="sourceCode latex"><code class="sourceCode latex"><span id="cb64-1"><a href="Latex.html#cb64-1" tabindex="-1"></a><span class="co">% 见胡伟133页</span></span>
<span id="cb64-2"><a href="Latex.html#cb64-2" tabindex="-1"></a><span class="fu">\setCJKfamilyfont</span>{myfs}[AutoFakeBold=2]{华文仿宋} <span class="co">% 指定仿宋一个新名字myfs，它是可以加粗的</span></span>
<span id="cb64-3"><a href="Latex.html#cb64-3" tabindex="-1"></a><span class="fu">\renewcommand*</span>{<span class="ex">\fangsong</span>}{<span class="fu">\CJKfamily</span>{myfs}} <span class="co">% 然后更新原有仿宋</span></span></code></pre></div>
</div>
<div id="使用某种常用字体" class="section level2 hasAnchor" number="7.10">
<h2><span class="header-section-number">7.10</span> 使用某种常用字体<a href="Latex.html#使用某种常用字体" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<ul>
<li>设置一个字体一般通过五个属性，即编码、字族、序列、形状和尺寸。然后通过</li>
</ul>
<div class="sourceCode" id="cb65"><pre class="sourceCode latex"><code class="sourceCode latex"><span id="cb65-1"><a href="Latex.html#cb65-1" tabindex="-1"></a><span class="fu">\DeclareFixedFont</span>{命令}{编码}{字族}{序列}{形状}{尺寸}</span></code></pre></div>
<p>来设置某一种字体。这些字体的例子可以参见胡伟的105页。</p>
<div id="如何使用一个新的字体" class="section level3 hasAnchor" number="7.10.1">
<h3><span class="header-section-number">7.10.1</span> 如何使用一个新的字体？<a href="Latex.html#如何使用一个新的字体" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>如果你在网上下载了某个字体：</p>
<ul>
<li>这个字体文件一般是<code>ttf</code>等后缀名，你要右键点击“为所有用户安装”，然后
可以通过在命令行输入<code>fc-list -f "%{family}\n" :lang=zh &gt;d:zhfont.txt</code>来查看在latex中调用时的名称，每个逗号隔开的都是可以调用的名称。比如，
如下代码设置了主要字体使用繁体字,并且字符旋转90度，实现繁体竖排。</li>
</ul>
<div class="sourceCode" id="cb66"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb66-1"><a href="Latex.html#cb66-1" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">xeCJK</span>}</span>
<span id="cb66-2"><a href="Latex.html#cb66-2" tabindex="-1"></a><span class="fu">\setCJKmainfont</span>[Vertical=RotatedGlyphs,CJKShape=Traditional]{Adobe Fangsong Std}</span></code></pre></div>
<p>对于字体更加详细的细节可以见https://zhuanlan.zhihu.com/p/260989874。</p>
<ul>
<li>如果不安装，那么也可以如下调用</li>
</ul>
<div class="sourceCode" id="cb67"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb67-1"><a href="Latex.html#cb67-1" tabindex="-1"></a><span class="co">% 导言区</span></span>
<span id="cb67-2"><a href="Latex.html#cb67-2" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">xeCJK</span>}</span>
<span id="cb67-3"><a href="Latex.html#cb67-3" tabindex="-1"></a><span class="fu">\setCJKfamilyfont</span>[Path = D:/]{mzd}{maozedong.ttf} <span class="co">% 字体文件是maozedong.ttf，给这个字体文件随便取个名，比如mzd</span></span>
<span id="cb67-4"><a href="Latex.html#cb67-4" tabindex="-1"></a><span class="fu">\newcommand</span>{<span class="ex">\mzd </span>} {<span class="fu">\CJKfamily</span>{mzd} } <span class="co">% 给这个字体名设置一个命令</span></span>
<span id="cb67-5"><a href="Latex.html#cb67-5" tabindex="-1"></a><span class="co">% 正文</span></span>
<span id="cb67-6"><a href="Latex.html#cb67-6" tabindex="-1"></a>{<span class="fu">\mzd</span> 我是骄阳} <span class="co">% 正文中就可以调用这个命令了。</span></span></code></pre></div>
<p>一个另外的例子：使用Times New Roman字体</p>
<div class="sourceCode" id="cb68"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb68-1"><a href="Latex.html#cb68-1" tabindex="-1"></a><span class="co">% 胡伟129页</span></span>
<span id="cb68-2"><a href="Latex.html#cb68-2" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">fontspec</span>}</span>
<span id="cb68-3"><a href="Latex.html#cb68-3" tabindex="-1"></a>{<span class="fu">\fontspec</span>{<span class="ex">times.ttf</span>}<span class="ex">I am TImes New Roman</span>}</span></code></pre></div>
</div>
</div>
<div id="我的r代码排版模版" class="section level2 hasAnchor" number="7.11">
<h2><span class="header-section-number">7.11</span> 我的R代码排版模版<a href="Latex.html#我的r代码排版模版" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<div id="listings包" class="section level3 hasAnchor" number="7.11.1">
<h3><span class="header-section-number">7.11.1</span> <code>listings</code>包<a href="Latex.html#listings包" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>导言区输入：</p>
<div class="sourceCode" id="cb69"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb69-1"><a href="Latex.html#cb69-1" tabindex="-1"></a><span class="fu">\lstset</span>{numbers=left, <span class="co">%设置行号位置</span></span>
<span id="cb69-2"><a href="Latex.html#cb69-2" tabindex="-1"></a>    basicstyle=<span class="fu">\ttfamily\small</span>,</span>
<span id="cb69-3"><a href="Latex.html#cb69-3" tabindex="-1"></a>    numberstyle=<span class="fu">\tiny</span>, <span class="co">%设置行号大小</span></span>
<span id="cb69-4"><a href="Latex.html#cb69-4" tabindex="-1"></a>    keywordstyle=<span class="fu">\color</span>{blue!70}, <span class="co">%关键字颜色</span></span>
<span id="cb69-5"><a href="Latex.html#cb69-5" tabindex="-1"></a>    commentstyle=<span class="fu">\color</span>{red!50!green!50!blue!50}, <span class="co">%评论颜色</span></span>
<span id="cb69-6"><a href="Latex.html#cb69-6" tabindex="-1"></a>    frame= shadowbox, <span class="co">%single, %设置边框格式</span></span>
<span id="cb69-7"><a href="Latex.html#cb69-7" tabindex="-1"></a>    rulesepcolor = <span class="fu">\color</span>{RoyalBlue},</span>
<span id="cb69-8"><a href="Latex.html#cb69-8" tabindex="-1"></a><span class="co">%    backgroundcolor = \color{RoyalBlue},</span></span>
<span id="cb69-9"><a href="Latex.html#cb69-9" tabindex="-1"></a>    escapeinside=``, <span class="co">%逃逸字符(1左面的键)，用于显示中文</span></span>
<span id="cb69-10"><a href="Latex.html#cb69-10" tabindex="-1"></a>    breaklines, <span class="co">%自动折行</span></span>
<span id="cb69-11"><a href="Latex.html#cb69-11" tabindex="-1"></a>    extendedchars=false, <span class="co">%解决代码跨页时，章节标题，页眉等汉字不显示的问题</span></span>
<span id="cb69-12"><a href="Latex.html#cb69-12" tabindex="-1"></a>    xleftmargin=2em,xrightmargin=2em, aboveskip=1em, <span class="co">%设置边距</span></span>
<span id="cb69-13"><a href="Latex.html#cb69-13" tabindex="-1"></a><span class="co">%   tabsize=4, %设置tab空格数</span></span>
<span id="cb69-14"><a href="Latex.html#cb69-14" tabindex="-1"></a>    showspaces=false, <span class="co">%不显示空格</span></span>
<span id="cb69-15"><a href="Latex.html#cb69-15" tabindex="-1"></a>    showtabs=flase, <span class="co">%不显示tab</span></span>
<span id="cb69-16"><a href="Latex.html#cb69-16" tabindex="-1"></a>    showstringspaces=false  <span class="co">%不显示字符串中的空格</span></span>
<span id="cb69-17"><a href="Latex.html#cb69-17" tabindex="-1"></a>}</span></code></pre></div>
<p>正文插入：</p>
<div class="sourceCode" id="cb70"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb70-1"><a href="Latex.html#cb70-1" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">lstlisting</span>}[language=R]</span>
<span id="cb70-2"><a href="Latex.html#cb70-2" tabindex="-1"></a><span class="vs">data(&quot;Affairs&quot;,package = &#39;AER&#39;) # `婚外情数据&#39;</span></span>
<span id="cb70-3"><a href="Latex.html#cb70-3" tabindex="-1"></a><span class="vs">Affairs$ynaffair[Affairs$affairs &gt;0] &lt;- 1</span></span>
<span id="cb70-4"><a href="Latex.html#cb70-4" tabindex="-1"></a><span class="vs">Affairs$ynaffair[Affairs$affairs == 0] &lt;- 0</span></span>
<span id="cb70-5"><a href="Latex.html#cb70-5" tabindex="-1"></a><span class="vs">Affairs$ynaffair &lt;- factor(Affairs$ynaffair,levels = c(0,1),labels = c(&#39;No&#39;,&#39;Yes&#39;))</span></span>
<span id="cb70-6"><a href="Latex.html#cb70-6" tabindex="-1"></a><span class="kw">\end</span>{<span class="ex">lstlisting</span>}        </span></code></pre></div>
<p>分页时，若页眉页脚有中文，会报错，此时最好把代码再次嵌入figure的浮动体中。</p>
<p>还有个我更喜欢的设置，</p>
<div class="sourceCode" id="cb71"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb71-1"><a href="Latex.html#cb71-1" tabindex="-1"></a><span class="fu">\lstset</span>{language = R, basicstyle = {<span class="fu">\ttfamily\small</span>},keywordstyle = <span class="fu">\color</span>{RoyalBlue},frame = lines, commentstyle=<span class="fu">\color</span>{gray},breaklines=true}</span>
<span id="cb71-2"><a href="Latex.html#cb71-2" tabindex="-1"></a><span class="co">% 或者阴影边框</span></span>
<span id="cb71-3"><a href="Latex.html#cb71-3" tabindex="-1"></a><span class="fu">\lstset</span>{language = R, basicstyle = {<span class="fu">\ttfamily\small</span>},keywordstyle = <span class="fu">\color</span>{RoyalBlue},frame = shadowbox, rulesepcolor=<span class="fu">\color</span>{gray},commentstyle=<span class="fu">\color</span>{gray},breaklines=true}</span></code></pre></div>
</div>
<div id="fancyvrb包" class="section level3 hasAnchor" number="7.11.2">
<h3><span class="header-section-number">7.11.2</span> <code>fancyvrb</code>包<a href="Latex.html#fancyvrb包" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>直接用<code>Verbatim</code>环境，从R语言里面直接copy. 可以参考胡伟76页对其参数的说明。</p>
<div class="sourceCode" id="cb72"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb72-1"><a href="Latex.html#cb72-1" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">Verbatim</span>}</span>
<span id="cb72-2"><a href="Latex.html#cb72-2" tabindex="-1"></a><span class="vs">a &lt;- 3</span></span>
<span id="cb72-3"><a href="Latex.html#cb72-3" tabindex="-1"></a><span class="kw">\end</span>{<span class="ex">Verbatim</span>}</span></code></pre></div>
</div>
</div>
<div id="latex插入附录" class="section level2 hasAnchor" number="7.12">
<h2><span class="header-section-number">7.12</span> latex插入附录<a href="Latex.html#latex插入附录" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<ul>
<li><code>\appendix</code>:说明之后的内容为附录。之后可以继续使用<code>\section{}</code>命令，只是此时显示为A、B等。</li>
<li><code>\appendixpage</code>将添加一个专门的附录页.</li>
<li><code>\addappheadtotoc</code>将附录添 加到目录当中，需要加载<code>\usepackage{appendix}</code>。不过，一旦附录开始，将不能转回正文。另一种方式可以使用 <code>/begin{appendices}和</code>/end{appendices}`在正文中添加附录，参看http://www.tex.ac.uk/cgi-bin/texfaq2html?label=appendix</li>
</ul>
<p>关于所有的latex相关的命令，有一本手册（书）<a href="http://tobi.oetiker.ch/lshort/lshort.pdf" class="uri">http://tobi.oetiker.ch/lshort/lshort.pdf</a> ，
好像有中文的翻译版本,点击http://net.ytu.edu.cn/share/%D7%CA%C1%CF/lshort-cn.pdf。</p>
</div>
<div id="latex参考文献的编码思路" class="section level2 hasAnchor" number="7.13">
<h2><span class="header-section-number">7.13</span> latex参考文献的编码思路<a href="Latex.html#latex参考文献的编码思路" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<div id="参考文献较少的情况" class="section level3 hasAnchor" number="7.13.1">
<h3><span class="header-section-number">7.13.1</span> 参考文献较少的情况<a href="Latex.html#参考文献较少的情况" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>就是定义一个参考文献环境, 然后用命令<code>\bibitem{Ale2019}</code>写即可，<code>99</code>是告诉文献有多少个，好排版，如下。这个<code>Ale2019</code>是为了方便正文引用。</p>
<pre><code>\begin{thebibliography}{99}
\bibitem{Ale2019}   Alessandri, P. and H. Mumtaz, 2019. Financial regimes and uncertainty shocks. Journal of Monetary Economics, 101: 31-46.
\end{thebibliography}</code></pre>
<p>关于正文引用格式的修改，参考胡伟（2011，p378）.</p>
</div>
<div id="参考文献较多的情况" class="section level3 hasAnchor" number="7.13.2">
<h3><span class="header-section-number">7.13.2</span> 参考文献较多的情况<a href="Latex.html#参考文献较多的情况" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>分两步：
1. 在记事本中把参考文献的信息记录下来，然后保存为.bib文件，放到源文件同目录下。可以使用JabRef软件帮忙管理。
2. 在正文中需要插入参考文献的地方写两个命令即可。如下，</p>
<pre><code>\bibliographystyle{文献格式名}
\bibliography{第一步建立的那个文件的名字，不需要bib后缀}</code></pre>
<p>进一步说明：
- 这种方法就是必须要在正文中有<code>\cite{}</code>，后面才有参考文献。如果正文没有引用，又想在参考文献中出现，可以使用<code>\nocite{}</code>
- 这种方法就可以指定期刊的参考文献风格，即修改<code>文献格式名</code>即可。如最普通的就是<code>plain</code>风格。</p>
</div>
<div id="如何将文献引用作为上标出现" class="section level3 hasAnchor" number="7.13.3">
<h3><span class="header-section-number">7.13.3</span> 如何将文献引用作为上标出现？<a href="Latex.html#如何将文献引用作为上标出现" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>四个办法：</p>
<ol style="list-style-type: decimal">
<li>将文献引用作为上标出现可以使用overcite 宏包
<code>\usepackage{overcite}</code></li>
<li>使用natbib 宏包的super 参数
<code>\usepackage[super]{natbib}</code></li>
<li>但是，这两种方法产生的上标引用都没有括号。要增加括号，可以修改这两个宏包中的相应定义。更简单的一个方法是使用如下命令，</li>
</ol>
<div class="sourceCode" id="cb75"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb75-1"><a href="Latex.html#cb75-1" tabindex="-1"></a><span class="fu">\makeatletter</span></span>
<span id="cb75-2"><a href="Latex.html#cb75-2" tabindex="-1"></a><span class="fu">\def\@cite</span>#1#2{<span class="fu">\textsuperscript</span>{[{#1<span class="fu">\if@tempswa</span> , #2<span class="fu">\fi</span>}]}}</span>
<span id="cb75-3"><a href="Latex.html#cb75-3" tabindex="-1"></a><span class="fu">\makeatother</span></span></code></pre></div>
<p>而不需使用任何宏包。</p>
<ol start="4" style="list-style-type: decimal">
<li><code>\usepackage[biblabel]{cite}</code>使用该命令即可</li>
</ol>
</div>
</div>
<div id="一些文体的模版" class="section level2 hasAnchor" number="7.14">
<h2><span class="header-section-number">7.14</span> 一些文体的模版<a href="Latex.html#一些文体的模版" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<div id="社科申报课题部分模版" class="section level3 hasAnchor" number="7.14.1">
<h3><span class="header-section-number">7.14.1</span> 社科申报课题部分模版<a href="Latex.html#社科申报课题部分模版" class="anchor-section" aria-label="Anchor link to header"></a></h3>
<p>申报书有两个特征：</p>
<ol style="list-style-type: decimal">
<li>页面要有边框，这可以通过使用<code>framed</code>包中的<code>framed</code>环境实现。但是这个环境没有参数可以设置，比如调整整个框的宽度。那么可以使用<code>\MakeFramed{&lt;setting&gt;}...\endMakeFramed</code>这个形式，它与<code>framed</code>环境本质上是一样的，但是此时可以调整参数了。譬如调整成原来款的1.5倍。</li>
</ol>
<div class="sourceCode" id="cb76"><pre class="sourceCode latex"><code class="sourceCode latex"><span id="cb76-1"><a href="Latex.html#cb76-1" tabindex="-1"></a><span class="fu">\MakeFramed</span>{<span class="fu">\hsize</span>=1.5<span class="fu">\hsize</span>}</span>
<span id="cb76-2"><a href="Latex.html#cb76-2" tabindex="-1"></a>这是你的文本</span>
<span id="cb76-3"><a href="Latex.html#cb76-3" tabindex="-1"></a><span class="fu">\endMakeFramed</span></span></code></pre></div>
<ol start="2" style="list-style-type: decimal">
<li>一般前面有个表格。如何让表格中的横线顶到边框，通过使用零宽度的盒子实现。命令为<code>\makebox[0pt][r]{\rule[11pt]{0.5cm}{0.05em}}</code>，如果你发现横线不能顶到左边，你还可以再画一根零宽度盒子，但是修改一下<code>r</code>参数为<code>l</code>,即<code>\makebox[0pt][l]{\rule[11pt]{0.5cm}{0.05em}}</code>。</li>
</ol>
<div class="sourceCode" id="cb77"><pre class="sourceCode tex"><code class="sourceCode latex"><span id="cb77-1"><a href="Latex.html#cb77-1" tabindex="-1"></a><span class="bu">\documentclass</span>[hyperref]{<span class="ex">article</span>}<span class="co">% 使得标签不乱码</span></span>
<span id="cb77-2"><a href="Latex.html#cb77-2" tabindex="-1"></a><span class="bu">\usepackage</span>[UTF8]{<span class="ex">ctex</span>}<span class="co">%中文宏包</span></span>
<span id="cb77-3"><a href="Latex.html#cb77-3" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">amsmath,bm,amsfonts,amssymb</span>}<span class="co">%数学宏包，amsfonts,amssymb是插入空心字母的包，使用命令\mathbb{}</span></span>
<span id="cb77-4"><a href="Latex.html#cb77-4" tabindex="-1"></a><span class="co">%\numberwithin{equation}{section}%公式按节进行编号</span></span>
<span id="cb77-5"><a href="Latex.html#cb77-5" tabindex="-1"></a><span class="bu">\usepackage</span>[dvipsnames]{<span class="ex">xcolor</span>}</span>
<span id="cb77-6"><a href="Latex.html#cb77-6" tabindex="-1"></a><span class="bu">\usepackage</span>[a4paper,left=2.14cm,right=2.14cm,bottom=2cm,top=2cm]{<span class="ex">geometry</span>}<span class="co">%页面设置宏包</span></span>
<span id="cb77-7"><a href="Latex.html#cb77-7" tabindex="-1"></a><span class="fu">\pagestyle</span>{headings}</span>
<span id="cb77-8"><a href="Latex.html#cb77-8" tabindex="-1"></a></span>
<span id="cb77-9"><a href="Latex.html#cb77-9" tabindex="-1"></a></span>
<span id="cb77-10"><a href="Latex.html#cb77-10" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">caption</span>}</span>
<span id="cb77-11"><a href="Latex.html#cb77-11" tabindex="-1"></a><span class="fu">\captionsetup</span>{figurename=图,tablename=表}<span class="co">%修改图标签名字</span></span>
<span id="cb77-12"><a href="Latex.html#cb77-12" tabindex="-1"></a><span class="co">%opening</span></span>
<span id="cb77-13"><a href="Latex.html#cb77-13" tabindex="-1"></a><span class="fu">\title</span>{草稿纸}</span>
<span id="cb77-14"><a href="Latex.html#cb77-14" tabindex="-1"></a><span class="fu">\author</span>{陈普}</span>
<span id="cb77-15"><a href="Latex.html#cb77-15" tabindex="-1"></a><span class="fu">\date</span>{<span class="fu">\today</span>}</span>
<span id="cb77-16"><a href="Latex.html#cb77-16" tabindex="-1"></a><span class="bu">\usepackage</span>{<span class="ex">graphicx,picinpar,multicol,bm,float,framed</span>}</span>
<span id="cb77-17"><a href="Latex.html#cb77-17" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">document</span>}</span>
<span id="cb77-18"><a href="Latex.html#cb77-18" tabindex="-1"></a>    <span class="fu">\maketitle</span></span>
<span id="cb77-19"><a href="Latex.html#cb77-19" tabindex="-1"></a><span class="co">% 这里是关键，通过用一个0宽度的盒子装填了表格中横线无法顶格的问题。</span></span>
<span id="cb77-20"><a href="Latex.html#cb77-20" tabindex="-1"></a>    <span class="kw">\begin</span>{<span class="ex">framed</span>}</span>
<span id="cb77-21"><a href="Latex.html#cb77-21" tabindex="-1"></a>        <span class="kw">\begin</span>{<span class="ex">table</span>}[H]</span>
<span id="cb77-22"><a href="Latex.html#cb77-22" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">tabular</span>}{ccp{39.8em}}<span class="fu">\hline</span></span>
<span id="cb77-23"><a href="Latex.html#cb77-23" tabindex="-1"></a><span class="fu">\makebox</span>[0pt][r]{<span class="fu">\rule</span>[11pt]{0.5cm}{0.05em}}1<span class="op">&amp;</span>1<span class="op">&amp;</span>1</span>
<span id="cb77-24"><a href="Latex.html#cb77-24" tabindex="-1"></a><span class="kw">\end</span>{<span class="ex">tabular</span>}</span>
<span id="cb77-25"><a href="Latex.html#cb77-25" tabindex="-1"></a>        <span class="kw">\end</span>{<span class="ex">table</span>}</span>
<span id="cb77-26"><a href="Latex.html#cb77-26" tabindex="-1"></a>        </span>
<span id="cb77-27"><a href="Latex.html#cb77-27" tabindex="-1"></a><span class="kw">\section</span>{验证一下汉密尔顿定理}    </span>
<span id="cb77-28"><a href="Latex.html#cb77-28" tabindex="-1"></a><span class="ss">\[max</span><span class="sc">\;</span><span class="ss"> </span><span class="sc">\sum</span><span class="ss">_{t=0}^</span><span class="sc">\infty</span><span class="ss"> </span><span class="sc">\beta</span><span class="ss">^tu(c_t)\]</span></span>
<span id="cb77-29"><a href="Latex.html#cb77-29" tabindex="-1"></a><span class="ss">\[k_{t+1}=(1-</span><span class="sc">\delta</span><span class="ss">)k_t+i_t\]</span></span>
<span id="cb77-30"><a href="Latex.html#cb77-30" tabindex="-1"></a>这里控制变量是<span class="ss">$ c_t $</span>，状态变量是<span class="ss">$ k_t $</span>。汉密尔顿函数可以写成，</span>
<span id="cb77-31"><a href="Latex.html#cb77-31" tabindex="-1"></a><span class="ss">\[H = </span><span class="sc">\beta</span><span class="ss">^tu(c_t) + </span><span class="sc">\pi</span><span class="ss">_{t+1}(f(k_t)-c_t-</span><span class="sc">\delta</span><span class="ss"> k_t)  \]</span></span>
<span id="cb77-32"><a href="Latex.html#cb77-32" tabindex="-1"></a>注意到<span class="ss">$ i_t= y_t-c_t $</span>，因此，<span class="ss">$ k_{t+1}-k_t=f(k_t)-c_t-</span><span class="sc">\delta</span><span class="ss"> k_t $</span>。然后根据汉密尔顿定理，有，</span>
<span id="cb77-33"><a href="Latex.html#cb77-33" tabindex="-1"></a><span class="kw">\begin</span>{<span class="ex">align*</span>}</span>
<span id="cb77-34"><a href="Latex.html#cb77-34" tabindex="-1"></a><span class="sc">\pi</span><span class="ss">_{t+1}-</span><span class="sc">\pi</span><span class="ss">_t=[-f&#39;(k_t)+</span><span class="sc">\delta</span><span class="ss">]</span><span class="sc">\pi</span><span class="ss">_{t+1}&amp;</span><span class="sc">\Longrightarrow</span><span class="ss"> </span><span class="sc">\pi</span><span class="ss">_t=[f&#39;(k_t)+(1-</span><span class="sc">\delta</span><span class="ss">)]</span><span class="sc">\pi</span><span class="ss">_{t+1}</span><span class="sc">\\</span></span>
<span id="cb77-35"><a href="Latex.html#cb77-35" tabindex="-1"></a><span class="sc">\beta</span><span class="ss">^tu&#39;(c_t)-</span><span class="sc">\pi</span><span class="ss">_{t+1}=0&amp;</span><span class="sc">\Longrightarrow</span><span class="ss"> </span><span class="sc">\beta</span><span class="ss">^tu&#39;(c_t)=</span><span class="sc">\pi</span><span class="ss">_{t+1}</span><span class="sc">\\</span></span>
<span id="cb77-36"><a href="Latex.html#cb77-36" tabindex="-1"></a><span class="kw">\end</span>{<span class="ex">align*</span>}</span>
<span id="cb77-37"><a href="Latex.html#cb77-37" tabindex="-1"></a></span>
<span id="cb77-38"><a href="Latex.html#cb77-38" tabindex="-1"></a>将<span class="ss">$ </span><span class="sc">\beta</span><span class="ss">^tu&#39;(c_t)=</span><span class="sc">\pi</span><span class="ss">_{t+1} $</span>的脚标做一个<span class="ss">$ t $</span>和<span class="ss">$ t+1 $</span>的替换，就有，</span>
<span id="cb77-39"><a href="Latex.html#cb77-39" tabindex="-1"></a><span class="ss">\[ f&#39;(k_t) +(1-</span><span class="sc">\delta</span><span class="ss">) = </span><span class="sc">\frac</span><span class="ss">{u&#39;(c_{t-1})}{</span><span class="sc">\beta</span><span class="ss"> u&#39;(c_{t})}\]</span></span>
<span id="cb77-40"><a href="Latex.html#cb77-40" tabindex="-1"></a>这就是著名的欧拉方程。</span>
<span id="cb77-41"><a href="Latex.html#cb77-41" tabindex="-1"></a>    <span class="kw">\end</span>{<span class="ex">framed</span>}</span>
<span id="cb77-42"><a href="Latex.html#cb77-42" tabindex="-1"></a><span class="kw">\end</span>{<span class="ex">document</span>}</span></code></pre></div>

</div>
</div>
</div>
            </section>

          </div>
        </div>
      </div>
<a href="C.html" class="navigation navigation-prev " aria-label="Previous page"><i class="fa fa-angle-left"></i></a>
<a href="Blog.html" class="navigation navigation-next " aria-label="Next page"><i class="fa fa-angle-right"></i></a>
    </div>
  </div>
<script src="libs/gitbook-2.6.7/js/app.min.js"></script>
<script src="libs/gitbook-2.6.7/js/clipboard.min.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-search.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-sharing.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-fontsettings.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-bookdown.js"></script>
<script src="libs/gitbook-2.6.7/js/jquery.highlight.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-clipboard.js"></script>
<script>
gitbook.require(["gitbook"], function(gitbook) {
gitbook.start({
"sharing": {
"github": false,
"facebook": true,
"twitter": true,
"linkedin": false,
"weibo": false,
"instapaper": false,
"vk": false,
"whatsapp": false,
"all": ["facebook", "twitter", "linkedin", "weibo", "instapaper"]
},
"fontsettings": {
"theme": "white",
"family": "sans",
"size": 2
},
"edit": {
"link": null,
"text": null
},
"history": {
"link": null,
"text": null
},
"view": {
"link": null,
"text": null
},
"download": ["CBook.pdf"],
"search": {
"engine": "fuse",
"options": null
},
"toc": {
"collapse": "subsection"
}
});
});
</script>

<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    var src = "true";
    if (src === "" || src === "true") src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/latest.js?config=TeX-MML-AM_CHTML";
    if (location.protocol !== "file:")
      if (/^https?:/.test(src))
        src = src.replace(/^https?:/, '');
    script.src = src;
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script>
</body>

</html>
